package com.vooda.dto.bo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * 测试表单
 *
 * @author charlee
 * @date 2017年11月30日
 */
@Data
@Builder
@ApiModel
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class TestBO extends BaseBO {

    @ApiModelProperty(value = "主键")
    @NotNull(message = "id不能为空", groups = {Put.class})
    private Long id;

    @ApiModelProperty(value = "名称")
    @NotNull(message = "名称不能为空", groups = {Post.class, Put.class})
    @Length(min = 1, max = 10, message = "长度在{min}到{max}之间", groups = {Post.class, Put.class})
    private String name;

    @ApiModelProperty(value = "邮箱")
    @NotNull(message = "邮箱不能为空", groups = {Post.class, Put.class})
    @Email(message = "不合法的邮箱格式", groups = {Post.class, Put.class})
    private String email;
}
